from django.contrib import admin
from models import CH_City, Location
from garetjax import maps

class CityAdmin(admin.ModelAdmin):    
    list_display = ('__unicode__', 'postal_code', 'name', 'latitude', 'longitude', 'gmap_link')
    
admin.site.register(CH_City, CityAdmin)

class LocationAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {
            'fields': ('name', 'link', 'place', 'description'),
        }),
        ('Geoplacement', {
            'classes': ('geoplacement',),
            'fields': ('latitude', 'longitude',),
        })
    )
    
    class Media:
        css = {
            "all": ("styles/gmapfield.css",),
        }
        js = (
            "http://www.google.com/jsapi",
            "scripts/jquery.js",
            "scripts/gmapfield.js",
        )

admin.site.register(Location, LocationAdmin)